//
//  WeatherTableViewCellTwo.m
//  ToWhere
//
//  Created by dllo on 15/11/14.
//  Copyright © 2015年 www.TE.com. All rights reserved.
//

#import "WeatherTableViewCellTwo.h"

@implementation WeatherTableViewCellTwo

- (void)dealloc
{
    [_weatherTwo release];
    [_weatherThree release];
    [_weatherTwoArray release];
    [_weatherThreeArray release];
    [_weaOne release];
    [_weaTwo release];
    [_weaThree release];
    [_weaFour release];
    [_weaFive release];
    [_weaSix release];
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{

    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {

            
        self.weaOne = [[Weather alloc] init];
        [self.contentView addSubview:_weaOne];
        [_weaOne release];
        
        _weaTwo = [[Weather alloc] init];
        [self.contentView addSubview:_weaTwo];
        [_weaTwo release];

        
        self.weaThree = [[Weather alloc] init];
        [self.contentView addSubview:_weaThree];
        [_weaThree release];

        
        self.weaFour = [[Weather alloc] init];
        [self.contentView addSubview:_weaFour];
        [_weaFour release];

        
        self.weaFive = [[Weather alloc] init];
        [self.contentView addSubview:_weaFive];
        [_weaFive release];

        
        self.weaSix = [[Weather alloc] init];
        [self.contentView addSubview:_weaSix];
        [_weaSix release];

        
    }
    return self;
}
- (void)layoutSubviews{

    [super layoutSubviews];
    self.weaOne.frame = CGRectMake(0, 0, 62.5 *kWidth, 400 *kHeight);
    self.weaTwo.frame = CGRectMake(62.5 *kWidth, 0, 62.5 *kWidth, 400 *kHeight);
    self.weaThree.frame = CGRectMake(62.5 * 2 *kWidth, 0, 62.5 *kWidth, 400 *kHeight);
    self.weaFour.frame = CGRectMake(62.5 *3 *kWidth, 0, 62.5 *kWidth, 400 *kHeight);
    self.weaFive.frame = CGRectMake(62.5 * 4 * kWidth, 0, 62.5 * kWidth, 400 * kHeight);
    self.weaSix.frame = CGRectMake(62.5 * 5 * kWidth, 0, 62.5 * kWidth, 400 * kHeight);
    
}
- (void)setWeatherThreeArray:(NSMutableArray *)weatherThreeArray{

    if (_weatherThreeArray != weatherThreeArray) {
        [_weatherThreeArray release];
        _weatherThreeArray = [weatherThreeArray retain];
    }
    self.weaOne.weatherThree = weatherThreeArray[0];
    self.weaTwo.weatherThree = weatherThreeArray[1];
    self.weaThree.weatherThree = weatherThreeArray[2];
    self.weaFour.weatherThree = weatherThreeArray[3];
    self.weaFive.weatherThree = weatherThreeArray[4];
    self.weaSix.weatherThree = weatherThreeArray[5];
}
- (void)setWeatherTwoArray:(NSMutableArray *)weatherTwoArray{

    if (_weatherTwoArray != weatherTwoArray) {
        _weatherTwoArray = [weatherTwoArray retain];
    }
    self.weatherTwo = weatherTwoArray[0];
    self.weaOne.weatherTwo = self.weatherTwo;
    self.weaTwo.weatherTwo = weatherTwoArray[1];
    self.weaThree.weatherTwo = weatherTwoArray[2];
    self.weaFour.weatherTwo = weatherTwoArray[3];
    self.weaFive.weatherTwo = weatherTwoArray[4];
    self.weaSix.weatherTwo = weatherTwoArray[5];

}

+ (WeatherTableViewCellTwo *)weatherTableViewCellTwoWithTableView:(UITableView *)tableView{

    static NSString *weatherTableViewCellTwo = @"weatherTableViewCellTwo";
    WeatherTableViewCellTwo *cell = [tableView dequeueReusableCellWithIdentifier:weatherTableViewCellTwo];
    if (!cell ) {
        
        cell = [[WeatherTableViewCellTwo alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:weatherTableViewCellTwo];
    }
    return cell;
}
@end
